package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementIsisRouteMapper;
import com.ruoyi.net.domain.ElementIsisRoute;
import com.ruoyi.net.service.IElementIsisRouteService;

/**
 * 网元-ISIS配置-ipv4地址族-路由重分发Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementIsisRouteServiceImpl implements IElementIsisRouteService 
{
    @Autowired
    private ElementIsisRouteMapper elementIsisRouteMapper;

    /**
     * 查询网元-ISIS配置-ipv4地址族-路由重分发
     * 
     * @param id 网元-ISIS配置-ipv4地址族-路由重分发主键
     * @return 网元-ISIS配置-ipv4地址族-路由重分发
     */
    @Override
    public ElementIsisRoute selectElementIsisRouteById(String id)
    {
        return elementIsisRouteMapper.selectElementIsisRouteById(id);
    }

    /**
     * 查询网元-ISIS配置-ipv4地址族-路由重分发列表
     * 
     * @param elementIsisRoute 网元-ISIS配置-ipv4地址族-路由重分发
     * @return 网元-ISIS配置-ipv4地址族-路由重分发
     */
    @Override
    public List<ElementIsisRoute> selectElementIsisRouteList(ElementIsisRoute elementIsisRoute)
    {
        return elementIsisRouteMapper.selectElementIsisRouteList(elementIsisRoute);
    }

    /**
     * 新增网元-ISIS配置-ipv4地址族-路由重分发
     * 
     * @param elementIsisRoute 网元-ISIS配置-ipv4地址族-路由重分发
     * @return 结果
     */
    @Override
    public int insertElementIsisRoute(ElementIsisRoute elementIsisRoute)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementIsisRoute.getId())) {
            elementIsisRoute.setId(uuid);
        }
        elementIsisRoute.setCreateBy(SecurityUtils.getUsername());
        elementIsisRoute.setCreateTime(DateUtils.getNowDate());
        elementIsisRoute.setUpdateBy(SecurityUtils.getUsername());
        elementIsisRoute.setUpdateTime(DateUtils.getNowDate());
        return elementIsisRouteMapper.insertElementIsisRoute(elementIsisRoute);
    }

    /**
     * 修改网元-ISIS配置-ipv4地址族-路由重分发
     * 
     * @param elementIsisRoute 网元-ISIS配置-ipv4地址族-路由重分发
     * @return 结果
     */
    @Override
    public int updateElementIsisRoute(ElementIsisRoute elementIsisRoute)
    {
        elementIsisRoute.setUpdateBy(SecurityUtils.getUsername());
        elementIsisRoute.setUpdateTime(DateUtils.getNowDate());
        return elementIsisRouteMapper.updateElementIsisRoute(elementIsisRoute);
    }

    /**
     * 批量删除网元-ISIS配置-ipv4地址族-路由重分发
     * 
     * @param ids 需要删除的网元-ISIS配置-ipv4地址族-路由重分发主键
     * @return 结果
     */
    @Override
    public int deleteElementIsisRouteByIds(String[] ids)
    {
        return elementIsisRouteMapper.deleteElementIsisRouteByIds(ids);
    }

    /**
     * 删除网元-ISIS配置-ipv4地址族-路由重分发信息
     * 
     * @param id 网元-ISIS配置-ipv4地址族-路由重分发主键
     * @return 结果
     */
    @Override
    public int deleteElementIsisRouteById(String id)
    {
        return elementIsisRouteMapper.deleteElementIsisRouteById(id);
    }
}
